package com.xdb.sqlparser.ast.statement;

import java.util.ArrayList;
import java.util.List;

import com.xdb.sqlparser.ast.SQLExpr;
import com.xdb.sqlparser.ast.SQLName;
import com.xdb.sqlparser.ast.AbstractSQLStatementImpl;
import com.xdb.sqlparser.ast.expr.SQLVariantRefExpr;
import com.xdb.sqlparser.visitor.SQLAstVisitor;

public class SQLCallStatement extends AbstractSQLStatementImpl {

	private boolean brace = false;

	private SQLVariantRefExpr outParameter;

	private SQLName procedureName;

	private final List<SQLExpr> parameters = new ArrayList<SQLExpr>();

	public SQLCallStatement() {

	}

	public SQLCallStatement(String dbType) {
		super(dbType);
	}

	public SQLVariantRefExpr getOutParameter() {
		return outParameter;
	}

	public void setOutParameter(SQLVariantRefExpr outParameter) {
		this.outParameter = outParameter;
	}

	public SQLName getProcedureName() {
		return procedureName;
	}

	public void setProcedureName(SQLName procedureName) {
		this.procedureName = procedureName;
	}

	public List<SQLExpr> getParameters() {
		return parameters;
	}

	public boolean isBrace() {
		return brace;
	}

	public void setBrace(boolean brace) {
		this.brace = brace;
	}

	protected void accept0(SQLAstVisitor visitor) {
		if (visitor.visit(this)) {
			acceptChild(visitor, this.outParameter);
			acceptChild(visitor, this.procedureName);
			acceptChild(visitor, this.parameters);
		}
		visitor.endVisit(this);
	}

}
